<div class="n-content">
	<?php
	$tools = array();
	//$tools[] = n_ui(n_url('passport','confEdit'),'设置');
	echo n_mod('skin')->pageHead("数据库配置列表",$tools)
	?>

	<div class="n-sep">
		<?php
		foreach($data['conf'] as $key=>$val){
		?>
		<dl class="n-box n-sep-bottom">
			<dt class="n-box-head">
				<span class="n-right">
					<?=n_ui(n_url('mysql','showStatus',array('id'=>$key)),'查看状态',"class='n-href n-btn n-btn-ccc'")?>
					<?=n_ui(n_url('mysql','showVar',array('id'=>$key)),'查看变量',"class='n-href n-btn n-btn-ccc'")?>
					<?=n_ui(n_url('mysql','showProcesslist',array('id'=>$key)),'查看进程',"class='n-href n-btn n-btn-ccc'")?>
					<?=n_ui(n_url('mysql','showTableStatus',array('id'=>$key)),'查看表状态',"class='n-href n-btn n-btn-ccc'")?>
				</span>
				<?=$key?>
			</dt>
			<dd class="n-box-body">
				<div class="n-sep">
					
				
					<?php
					if(isset($val['type']) && 'ms'==$val['type']){
					?>
					<span class="n-red">master</span>IP：<?=$val['master']['host']?>
					账号：<?=$val['master']['user']?>
					库名：<?=$val['master']['dbname']?><br />
					
					<?php
						//print_r($val['master']);
						foreach($val['slave'] as $key1=>$val1){
						?>
							-------<span class="n-red">slave</span>IP：<?=$val1['host']?>
							账号：<?=$val1['user']?>
							库名：<?=$val1['dbname']?><br />
							
						
						<?php
						}
					}else{
					?>
					IP：<?=$val['host']?>
					账号：<?=$val['user']?>
					库名：<?=$val['dbname']?><br />
					
					<?php
					}
					?>
					
					<div style="display: inline-block;">
						SQL:<textarea name="sql" class="<?=$key?>sql"></textarea>
						<input type="button" value="执行" onclick="ui.open('/mysql/execTest.html',{'mhandle':'<?=$key?>','sql':$('.<?=$key?>sql').val()})" />
					</div>
				</div>
			</dd>
		</dl>
		<?php
		}
		?>
	</div>
</div>


